load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
    name = "roachprod-microbench_lib",
    srcs = [
        "clean.go",
        "compare.go",
        "compress.go",
        "executor.go",
        "export.go",
        "main.go",
        "metadata.go",
        "report.go",
        "slack.go",
        "stage.go",
        "util.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod-microbench",
    visibility = ["//visibility:private"],
    deps = [
        "//pkg/cmd/roachprod-microbench/cluster",
        "//pkg/cmd/roachprod-microbench/google",
        "//pkg/cmd/roachprod-microbench/model",
        "//pkg/roachprod",
        "//pkg/roachprod/config",
        "//pkg/roachprod/install",
        "//pkg/roachprod/logger",
        "//pkg/roachprod/ssh",
        "//pkg/util/retry",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_klauspost_pgzip//:pgzip",
        "@com_github_slack_go_slack//:slack",
        "@com_github_spf13_cobra//:cobra",
        "@org_golang_x_exp//maps",
        "@org_golang_x_perf//benchfmt",
    ],
)

go_binary(
    name = "roachprod-microbench",
    embed = [":roachprod-microbench_lib"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "roachprod-microbench_test",
    srcs = [
        "compare_test.go",
        "executor_test.go",
        "export_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":roachprod-microbench_lib"],
    deps = [
        "//pkg/cmd/roachprod-microbench/model",
        "//pkg/testutils/datapathutils",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_exp//maps",
    ],
)
